<?php
/**
 * @version $Id: mod_unocart_latest_products.php 22 2010-05-17 22:03:42Z vladzimirs@gmail.com $
 * @package UnoCart
 * @copyright Авторские права (C) 2009-2010 UnoCart team & (C) 2007-2010 Joostina team &. Все права защищены.
 * @license Лицензия http://www.gnu.org/licenses/gpl-2.0.htm GNU/GPL, или help/license.php
 * UnoCart! - свободное программное обеспечение распространяемое по условиям лицензии GNU/GPL
 * Для получения информации о используемых расширениях и замечаний об авторском праве, смотрите файл help/copyright.php.
 */
defined('_VALID_MOS') or die('Direct Access to this location is not allowed.');
global $unocartConfig, $mainframe;
require_once (Jconfig::getInstance()->config_absolute_path .
    "/components/com_unocart/unocart.php");
$count = intval($params->get('count_products', 5));
$count_product_to_row = intval($params->get('count_products_in_row', 1));
$category_id = $params->get('category_id', '');
$array_categories = ($category_id) ? (explode(",", $category_id)) : (array());
$products = unocartProduct::getLastProducts($count, $array_categories);
foreach ($products as $key => $value) {
    $products[$key]->product_link = SEFLink('index.php?option=com_unocart&task=product&product_id=' .
        $value->product_id . '&category_id=' . $value->category_id);
}
$smarty = smarty_init();
$smarty->assign('products', $products);
$smarty->assign('count_product_to_row', $count_product_to_row);
$smarty->assign('image_product_path', $unocartConfig->image_product_live_path);
$smarty->assign('width', intval($params->get('width_box', 250)));
$smarty->assign('height', intval($params->get('height_box', 150)));
$smarty->assign('scroll', intval($params->get('scroll', 0)));
$smarty->assign('image_product_path', $unocartConfig->image_product_live_path);
$smarty->display('module_latest_products.tpl');
?>